package com.tensquare.ai.task;

import com.tensquare.ai.service.CnnService;
import com.tensquare.ai.service.Word2VecService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 任务类
 */
@Component
public class AiTask {

    @Autowired
    private Word2VecService word2VecService;

    @Autowired
    private CnnService cnnService;

    /**
     * 训练方法
     */
    @Scheduled(cron = "0 20 17 * * ?")
    public void train(){
       /* System.out.println("开始合并");
        word2VecService.merge();
        System.out.println("合并结束");*/

       /*System.out.println("开始构建词向量");
       word2VecService.build();
       System.out.println("构建词向量结束");*/

        System.out.println("开始构建卷积神经网络模型");
        cnnService.build();
        System.out.println("构建卷积神经网络模型结束");
    }

}
